<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"
	import="java.util.ArrayList,com.metagurukul.metagranth.vo.Question,com.metagurukul.metagranth.vo.Answer"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" href="../css/layout.css" type="text/css"
	media="screen" />
<!--[if lt IE 9]>
	<link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" />
	<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
<script src="../js/jquery-1.5.2.min.js" type="text/javascript"></script>
<script src="../js/hideshow.js" type="text/javascript"></script>
<script src="../js/jquery.tablesorter.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/jquery.equalHeight.js"></script>
<script type="text/javascript">

function checkEmpty(thisForm) {
	with(thisForm)
	{
		if(radio.checked == false) {
			alert("Please select atleast one Answer");
			return false;
		}
		
	}
	return true;
}

	$(document).ready(function() {
		$(".tablesorter").tablesorter();
	});
	$(document).ready(function() {

		//When page loads...
		$(".tab_content").hide(); //Hide all content
		$("ul.tabs li:first").addClass("active").show(); //Activate first tab
		$(".tab_content:first").show(); //Show first tab content

		//On Click Event
		$("ul.tabs li").click(function() {

			$("ul.tabs li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".tab_content").hide(); //Hide all tab content

			var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
			$(activeTab).fadeIn(); //Fade in the active ID content
			return false;
		});

	});
</script>
<script type="text/javascript">
	$(function() {
		$('.column').equalHeight();
	});
</script>
</head>

<%
if(request.getAttribute("answerList")!=null){
ArrayList<Answer> answerList = (ArrayList<Answer>)request.getAttribute("answerList");
System.out.println(answerList.get(0).getAnswer());

Question question = (Question)request.getAttribute("question");
%>




<body>

<header id="header"> <hgroup>
	<h1 class="site_title">
		<a href="home.jsp">Website Admin</a>
	</h1>
	<h2 class="section_title">Dashboard</h2>
	
		</header>
		<form name="myForm" action="closequestion.do" onsubmit="return checkEmpty(myForm)">
		<div class="module_content">
		<h3>Question : &nbsp;&nbsp;
			<%=question.getQuestion() %></h3>
			<HR>
			<h3>Answer </h3>
				<br/>
				<%for(Answer answer : answerList) { %>
				<input type="radio" name="checkanswer" id="radio" value="<%=answer.getAid() %>" /> 
				<textarea  name="description" id="description" readonly="readonly"><%=answer.getAnswer() %></textarea><br><hr>
				<%} %>
				<br>
				
				
				<input type="submit" name="submit" value="Submit" > 
</form>
<a href="home.jsp">Back to Admin Home Page</a>
</body>
<%} %>
</html>